home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 5 / Skunkware 5.iso / src / Tools / freeWAIS-sf-1.1 / ir / futil.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-05-19  |  2.3 KB  |  80 lines

  1. /* WIDE AREA INFORMATION SERVER SOFTWARE
  2.    No guarantees or restrictions.  See the readme file for the full standard
  3.    disclaimer.  
  4.   
  5. */
  6.  
  7. /* Copyright (c) CNIDR (see ../COPYRIGHT) */
  8.  
  9.  
  10. #ifndef FUTIL_H
  11. #define FUTIL_H
  12.  
  13. #include "cdialect.h"
  14. #include "cutil.h"
  15.  
  16.  
  17. #define MAX_FILE_NAME_LEN 255
  18.  
  19. #define FType long
  20.  
  21. /* the following defines should be in stdio.h, but the
  22.    gnu C compiler doesn't define them for some reason
  23.  */
  24. #ifndef SEEK_SET 
  25. #define SEEK_SET 0  /* ANSI added by brewster */
  26. #define SEEK_CUR 1  /* ANSI added by brewster */
  27. #define SEEK_END 2  /* ANSI added by brewster */
  28. #endif
  29.  
  30. /* enhanced standard functions - don't call them directly, use the
  31.    macros below */
  32. FILE*    fs_fopen _AP((char* fileName,char* mode));
  33. long    fs_fclose _AP((FILE* file));
  34. long     fs_fseek _AP((FILE* file,long offset,long wherefrom));
  35. long     fs_ftell _AP((FILE* file));
  36. char    *fs_fzcat _AP((char *fileName));
  37.  
  38. #ifdef __cplusplus
  39. /* declare these as C style functions */
  40. extern "C"
  41.     {
  42. #endif /* def __cplusplus */
  43.  
  44. /* macros for standard functions.  call these in your program.  */
  45. #define s_fopen(name,mode)    fs_fopen((name),(mode))
  46. #define s_fzcat(name)           fs_fzcat((name))
  47. #define s_fclose(file)        { fs_fclose((FILE*)file); file = NULL; }
  48. #define s_fseek(file,offset,wherefrom) fs_fseek(file,offset,wherefrom)
  49. #define s_ftell(file)    fs_ftell(file)
  50.  
  51. void grow_file _AP((FILE* file,long length));
  52. long read_bytes _AP((long n_bytes,FILE *stream));
  53. long write_bytes _AP((long value, long n_bytes, FILE* stream));
  54. long read_bytes_from_memory _AP((long n_bytes, unsigned char* block));
  55. time_t file_write_date _AP((char* filename)); /* os dependent */
  56. char *truename _AP((char *filename, char *full_path));
  57. long file_length _AP((FILE* stream));
  58. char *pathname_name _AP((char *pathname));
  59. char *pathname_directory _AP((char *pathname, char *destination));
  60. char *current_user_name _AP((void));
  61. boolean probe_file _AP((char *filename));
  62. boolean probe_file_possibly_compressed _AP((char *filename));
  63. boolean touch_file _AP((char *filename));
  64. char *merge_pathnames _AP((char *pathname, char *directory));
  65.  
  66. #ifdef THINK_C
  67. void setFileType _AP((char* fileName,FType type,FType creator));
  68. #endif /* def THINK_C */
  69.  
  70. boolean read_string_from_file _AP((FILE* stream,char* array,
  71.                    long array_length));
  72.  
  73. long count_lines _AP((FILE *stream));
  74.  
  75. #ifdef __cplusplus
  76.     }
  77. #endif /* def __cplusplus */
  78.  
  79. #endif /* FUTIL_H */
  80.